package com.jtzc.mcp.csdn.domain.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.jtzc.mcp.csdn.types.utils.MarkdownConverter;
import lombok.Data;



@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ArticlePublishRequest {

    @JsonProperty(required = true, value = "title")
    @JsonPropertyDescription("文章标题")
    private String title;

    @JsonProperty(required = true, value = "markDownContent")
    @JsonPropertyDescription("文章内容")
    private String markDownContent;

    @JsonProperty(required = true, value = "tags")
    @JsonPropertyDescription("文章标签，英文逗号隔开")
    private String tags;

    @JsonProperty(required = true, value = "description")
    @JsonPropertyDescription("文章简述")
    private String description;

    @JsonProperty(required = false, value = "cookie")
    @JsonPropertyDescription("CSDN登录Cookie（可选，如果未提供则使用启动时通过--cookie参数配置的默认值）")
    private String cookie;

    public String getContent() {
        return MarkdownConverter.convertToHtml(markDownContent);
    }

}
